import { Transform } from 'class-transformer';
import { Util } from 'src/common/Util';

/*
 * @Author: jingfuu@163.com
 * @Date: 2024-11-29 17:01:38
 * @LastEditTime: 2024-12-03 14:38:02
 * @Description: 系统通知
 */
class NoticeDto {
  noticeId: number;
  noticeTitle: string;
  //公告类型（1通知 2公告 3私信）
  noticeType: string;
  @Transform(({ value }) => value?.toString('utf8'))
  noticeContent: string;
  status: string;
  @Transform(({ value }) => Util.convertTimeStr(value))
  startTime: string | Date;
  @Transform(({ value }) => Util.convertTimeStr(value))
  endTime: string | Date;
  userId: number;
  createBy: string;
  @Transform(({ value }) => Util.convertTimeStr(value))
  createTime: string;
  updateBy: string;
  @Transform(({ value }) => Util.convertTimeStr(value))
  updateTime: string;
  remark: string;
  /**
   * 当noticeType为3时，代表用户接收到的未阅读消息总数
   */
  msgCount: number = 0;
}
export default NoticeDto;
